<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.pageInfoUtil }" var="pageInfoUtil"/>
<c:set value="${requestScope.response.data.list }" var="list"/>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>商品列表 - 美妆产品销售系统</title>
		<%@ include file="/common/include/head_title.jsp"%>
	</head>
	<body>
		<jsp:include page="/header"/>
		<div id="mainBody">
			<div class="container">
				<div class="row">
					<%@ include file="/common/include/leftBar.jsp"%>
					<div class="span9">
						<ul class="breadcrumb">
							<li><a href="${rootPath }//main">首页</a><span class="divider">/</span></li>
							<li class="active">商品列表</li>
						</ul>
						<h3>商品列表 <small class="pull-right"> 共${pageInfoUtil.totalRecord }件商品</small>
						</h3>
						<hr class="soft">
						<!-- <p>Nowadays the lingerie industry is one of the most successful
							business spheres.We always stay in touch with the latest fashion
							tendencies - that is why our goods are so popular and we have a
							great number of faithful customers all over the country.</p> -->
						<hr class="soft">
						<!-- <form class="form-horizontal span6">
							<div class="control-group">
								<label class="control-label alignL">排序 </label> <select>
									<option>Priduct name A - Z</option>
									<option>Priduct name Z - A</option>
									<option>Priduct Stoke</option>
									<option>Price Lowest first</option>
								</select>
							</div>
						</form> -->
						<div id="myTab" class="pull-right">
							<a href="#listView" data-toggle="tab">
								<span class="btn btn-large"><i class="icon-list"></i></span>
							</a>
							<a href="#blockView" data-toggle="tab">
								<span class="btn btn-large btn-primary"><i class="icon-th-large"></i></span>
							</a>
						</div>
						<br class="clr">
						<div class="tab-content">
							<div class="tab-pane" id="listView">
								<c:forEach items="${list }" var="listTemp" varStatus="stat">
									<div class="row">
										<div class="span2">
											<c:choose>
												<c:when test="${listTemp.listImg != null && listTemp.listImg != '' }">
													<a href="${rootPath}//goodsInfo?id=${listTemp.id}" target="_blank">
														<img alt="" src="${rootPath}${listTemp.listImg }" width="160" height="160">
													</a>
												</c:when>
												<c:otherwise>
													<img alt="" src="${rootPath }/img/no_pic.png" width="160" height="160">
												</c:otherwise>
											</c:choose>
										</div>
										<div class="span4">
											<h3 title="${listTemp.title }">
												<a href="${rootPath }//goodsInfo?id=${listTemp.id}" target="_blank" title="${listTemp.title }">
													${fn:substring(listTemp.title,0,subStrLen) }
												</a>
											</h3>
											<hr class="soft">
											<%-- <h5>${listTemp.title }</h5> --%>
											<p title="${listTemp.brief }">${fn:substring(listTemp.brief,0,subStrLen) }</p>
											<a class="btn btn-small pull-right" 
												href="${rootPath }//goodsInfo?id=${listTemp.id}" target="_blank" title="${listTemp.title }">详情</a> <br class="clr">
										</div>
										<div class="span3 alignR">
											<form class="form-horizontal qtyFrm">
												<h3>${listTemp.price }</h3>
												<!-- <label class="checkbox">
													<input type="checkbox"> Adds product to compair
												</label>
												<br> -->
												<a href="" onclick="return addCart('${listTemp.id}','1')" class="btn btn-large btn-primary"> 添加 
													<i class=" icon-shopping-cart"></i>
												</a>
												<a href="${rootPath }//goodsInfo?id=${listTemp.id}" class="btn btn-large">
													<i class="icon-zoom-in"></i>
												</a>
		
											</form>
										</div>
									</div>
									<hr class="soft">
								</c:forEach>
							</div>
	
							<div class="tab-pane  active" id="blockView">
								<ul class="thumbnails">
									<c:forEach items="${list }" var="listTemp" varStatus="stat">
										<li class="span3">
											<div class="thumbnail">
												<a href="${rootPath }//goodsInfo?id=${listTemp.id}" target="_blank" title="${listTemp.title }">
													<c:choose>
														<c:when test="${listTemp.listImg != null && listTemp.listImg != '' }">
															<a href="${websiteFileUrl}${listTemp.listImg }" target="_blank">
																<img alt="" src="${rootPath }${listTemp.listImg }" width="160" height="160">
															</a>
														</c:when>
														<c:otherwise>
															<img alt="" src="${rootPath }/img/no_pic.png" width="160" height="160">
														</c:otherwise>
													</c:choose>
												</a>
												<div class="caption">
													<h5 title="${listTemp.title }">
														<a href="${rootPath }//goodsInfo?id=${listTemp.id}" target="_blank" title="${listTemp.title }">
															${fn:substring(listTemp.title,0,subStrLen) }
														</a>
													</h5>
													<p title="${listTemp.brief }">${fn:substring(listTemp.brief,0,subStrLen) }</p>
													<h4 style="text-align: center">
														<a class="btn" href="${rootPath }//goodsInfo?id=${listTemp.id}" target="_blank" title="${listTemp.title }">
															<i class="icon-zoom-in"></i>
														</a>
														<a class="btn" href="#" onclick="return addCart('${listTemp.id}','1')">
															添加 <i class="icon-shopping-cart"></i>
														</a> <a class="btn btn-primary" href="#">${listTemp.price }</a>
													</h4>
												</div>
											</div>
										</li>
									</c:forEach>
								</ul>
								<hr class="soft">
							</div>
						</div>
	
						<div class="pagination">
							<ul>
								<li><a href="${rootPath }/goodsList?cateId=${requestScope.cateId}&keyword=${requestScope.keyword}&currentPage=1"><<</a></li>
								<li><a href="${rootPath }/goodsList?&cateId=${requestScope.cateId}&keyword=${requestScope.keyword}&currentPage=${pageInfoUtil.prePage }"><</a></li>
								<li><a href="${rootPath }/goodsList?&cateId=${requestScope.cateId}&keyword=${requestScope.keyword}&currentPage=${pageInfoUtil.nextPage }">></a></li>
								<li><a href="${rootPath }/goodsList?&cateId=${requestScope.cateId}&keyword=${requestScope.keyword}&currentPage=${pageInfoUtil.totalPage }">>></a></li>
								${pageInfoUtil.currentPage }/${pageInfoUtil.totalPage }
							</ul>
						</div>
						<br class="clr">
					</div>
				</div>
			</div>
		</div>
		<%@ include file="/common/include/head_footer.jsp"%>
	</body>
</html>